/*
 * WarehouseClient.java
 *
 * $Id: ProductStockClient.java,v 1.1 2009-10-07 10:19:31 mario Exp $
 */
package org.ceteca.explica.client.warehouse;

import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.HashSet;

import org.ceteca.explica.client.ClientContext;
import org.ceteca.explica.client.gui.ExplicaDateSelect;
import org.ceteca.explica.client.gui.ExplicaDetailEntityView;
import org.ceteca.explica.client.gui.ExplicaGUIBuilder;
import org.ceteca.explica.client.gui.common.CommonClient;
import org.ceteca.explica.core.ExplicaException;
import org.ceteca.explica.core.InterfaceExplica;
import org.ceteca.explica.core.common.BaseVO;
import org.ceteca.explica.core.common.MultiSelectionSubentityOT;
import org.ceteca.explica.core.common.RegistryOT;
import org.ceteca.explica.core.common.SelectionSubentityOT;
import org.ceteca.explica.core.partners.AddressOT;
import org.ceteca.explica.core.partners.InterfacePartners;
import org.ceteca.explica.core.util.Converter;
import org.ceteca.explica.core.util.OperationResult;
import org.ceteca.explica.core.warehouse.InterfaceWarehouse;
import org.ceteca.explica.core.warehouse.ProductGroupOT;
import org.ceteca.explica.core.warehouse.ProductStockOT;
import org.ceteca.explica.core.warehouse.ProductOT;
import org.ceteca.explica.core.warehouse.WarehouseManager;
import org.ceteca.javaglade.Gui;
import org.ceteca.javaglade.InterfaceGladeGtk;
import org.ceteca.javaglade.toolkit.swt.SwtWidget;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolItem;

public class ProductStockClient extends CommonClient {
	/**
     * Message for logging the entity glade configuration file path.
     */
    public static final String EXPLICA_LOG_EDITSTOCK_GLADEPATH = "The stock edition interface configuration file has been found at this path: %s";
    
    public ProductStockClient() {
    	super(	ProductStockOT.class,
				InterfaceWarehouse.EXPLICA_EDIT_STOCK_GLADE_PATH,
				InterfaceWarehouse.EDIT_STOCK_DIALOG_NAME);
    }
	
    @Override
	public ArrayList getEntityFields() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void fillEntityData() {
	}

	@Override
	public void clearEntityData() {
	}

	@Override
	public BaseVO getEntityData() {
		return null;
	}

	@Override
	public void updateEntityData() {
	}

	@Override
	public void setEditionMode(boolean enabled) {

	}
	
	@Override
	public void build_extension_fields_view() {
	}

	@Override
	public void buildSelectionSets() {
	}

	@Override
	public void getWidgets() {
	}

	@Override
	public void init_specific_components() {
		this.entEditView.dispose();
		this.entEditView = null;

		// Disable the add, view and edit entity buttons
		Gui entGui = this.entView.getGui();
		((Control)entGui.getWidget(InterfaceExplica.EXPLICA_ENTITY_TOOLITEM_ADD_NAME)).setEnabled(false);
		((Control)entGui.getWidget(InterfaceExplica.EXPLICA_ENTITY_TOOLITEM_EDIT_NAME)).setEnabled(false);
		((Control)entGui.getWidget(InterfaceExplica.EXPLICA_ENTITY_TOOLITEM_VIEW_NAME)).setEnabled(false);
	}

	@Override
	public void setWidgetsValues(BaseVO entity) {
	}

	@Override
	public OperationResult validateEntity() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public ExplicaDetailEntityView buildEntity(SwtWidget parent,
			MultiSelectionSubentityOT subentityData, String rootName) {
		this.entityDetailView = super.buildEntity(parent, subentityData, rootName);
		this.entView = null;
		
//		this.entEditView.dispose();
//		this.entEditView = null;

		// Disable the add, view and edit entity buttons
		Gui entGui = this.entityDetailView.getGui();
		((ToolItem)entGui.getWidget(InterfaceExplica.EXPLICA_ENTITY_TOOLITEM_ADD_NAME)).setEnabled(false);
		((ToolItem)entGui.getWidget(InterfaceExplica.EXPLICA_ENTITY_TOOLITEM_EDIT_NAME)).setEnabled(false);
		((ToolItem)entGui.getWidget(InterfaceExplica.EXPLICA_ENTITY_TOOLITEM_VIEW_NAME)).setEnabled(false);
		((ToolItem)entGui.getWidget(InterfaceExplica.EXPLICA_ENTITY_TOOLITEM_SELECT_NAME)).setEnabled(false);
		((ToolItem)entGui.getWidget(InterfaceExplica.EXPLICA_ENTITY_TOOLITEM_DEL_NAME)).setEnabled(false);
		
		return this.entityDetailView;
	}

	/**
	 * Returns tag Id assigned to CVS source file.
	 */
	public static String getRevision() {
		return "$Id: ProductStockClient.java,v 1.1 2009-10-07 10:19:31 mario Exp $";
	}
}
